{% extends 'layout.html' %}

{% block content %}
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
    <meta charset="UTF-8">
    <ol class="breadcrumb">
        <li><a href="#">首页</a></li>
        <li><a href="#">数据列表</a></li>
        <li class="active">分配用户角色</li>
    </ol>
    <div class="panel panel-default">
        <div class="panel-heading">表单数据</div>
        <div class="panel-body">
            <form action="" method="post" role="form">
                {% csrf_token %}
                {% for role in role_choice %}
                    <input type="checkbox" id="{{ role.id }}" name="roles" value="{{ role.id }}" {% if role.id in selected_role_ids %}checked{% endif %}>
                    <label for="{{ role.id }}">{{ role.role_name }}</label><br>
                {% endfor %}
                <input type="submit" value="提交">
            </form>
        </div>
    </div>
</div>
{% endblock %}
